import TableList from "./tablelist";
import { HttpGetErpSku } from '../../service/base';
import { resolveComponent } from "vue";
export default {
    mixins: [TableList],
    data() {
        return {
            isMixin: true,
            Searchs: {
                show: true,
                // style: "border:none;",
                // labelWidth: 'auto',
                // align: "left",
            },
        };
    },
    methods: {
        ajaxRequest: HttpGetErpSku,
        interceptRequest(params) {
            // params.search.EQ_status = 0
            // params.search.EQ_enable = 1
            // delete params.rows
            // delete params.page
            return params
        },
    },
    computed: {
        SearchsData() {
            let widthStyle = "width: 120px;"
            return [{
                label: "ERP SKU",
                tag: 'Input',
                key: 'CN_erpSku',
                show: true,
                style: widthStyle
            },
            {
                label: this.$t('erp.product.customise_product_code', { defaultValue: '自定义产品编码' }),
                tag: 'Input',
                key: 'CN_erpSkuCode',
                show: true,
                style: widthStyle
            },
            {
                label: this.$t('fbb.inbound.CN_name', { defaultValue: '名称(中文)' }),
                tag: 'Input',
                key: 'CN_name',
                show: true,
                style: widthStyle
            },
            {
                label: this.$t('global.common.En_name', { defaultValue: '名称(英文)' }),
                tag: 'Input',
                key: 'CN_nameEn',
                show: true,
                style: widthStyle
            }
        ]
        },
        columns() {
            return [{
                title: "No.",
                type: 'index',
                width: 60,
            }, {
                title: "ERP SKU",
                key: 'erpSku'
            }, {
                title: this.$t('erp.product.customise_product_code', { defaultValue: '自定义产品编码' }),
                key: 'erpSkuCode'
            }, {
                title: this.$t('fbb.inbound.CN_name', { defaultValue: '名称(中文)' }),
                key: 'name'
            },{
                title: this.$t('global.common.En_name', { defaultValue: "名称(英文)" }),
                key: 'nameEn'
            },
            {
                title: this.$t('global.common.actions', { defaultValue: "操作" }),
                width: 120,
                align: 'center',
                render: (h, { row }) => {
                    return h(resolveComponent('Button'), {
                        type: 'primary',
                        size: "small",
                        onClick:() => {
                            this.$emit('on-data', row)
                        },
                        // nativeOn: {
                        //     click: () => {
                        //         this.$emit('on-data', row)
                        //     }
                        // }
                    }, this.$ct('fbb.inbound.choose', { defaultValue: "选择" }))
                }
            }]
        }
    }

};